package dto

import (
	"github.com/e421083458/gin_scaffold/public"
	"github.com/gin-gonic/gin"
)

//商品分类

type Sort struct {
	Id string `form:"id" json:"id" comment:"Id默认传1" validate:"required"`
}

func (params *Sort) BindingValidParams(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

//商品症状标签分类

type UType struct {
	UnsId string `form:"uns_id" json:"id" comment:"UnsId默认传1" validate:""`
}

func (params *UType) BindingValidParams(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

//创建订单

type Order struct {
	Type        int    `form:"type" json:"type" comment:"订单类型" validate:""`
	OrderId     string `form:"order_id" json:"order_id" comment:"订单编号" validate:""`
	Uid         int    `form:"uid" json:"uid" comment:"uid" validate:""`
	RealName    string `form:"real_name" json:"real_name" comment:"real_name收件人" validate:""`
	UserPhone   string `form:"user_phone" json:"user_phone" comment:"user_phone收件人电话" validate:""`
	UserAddress string `form:"user_address" json:"user_address" comment:"user_address收件地址" validate:""`
	ProductId   int    `form:"productid" json:"productid" comment:"productid商品id" validate:""`
	TotalNum    int    `form:"total_num" json:"total_num" comment:"total_num数量" validate:"required"`
}

func (params *Order) BindingValidParams(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

//订单详情
type Orderinfo struct {
	OrderId string `form:"order_id" json:"order_id" comment:"订单编号" validate:"required"`
}

func (params *Orderinfo) BindingValidParams(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}

//预支付
type Payinfo struct {
	Id      int    `form:"id" json:"id" comment:"编号" validate:""`
	OrderId string `form:"order_id" json:"order_id" comment:"订单编号" validate:"required"`
	Uid     int    `form:"uid" json:"uid" comment:"uid" validate:""`
	//Openid  int    `form:"open_id" json:"open_id" comment:"open_id" validate:"required"`
}

func (params *Payinfo) BindingValidParams(c *gin.Context) error {
	return public.DefaultGetValidParams(c, params)
}
